#include "bsp_rc.h"
#include "main.h"
#include "remote_control.h"

extern UART_HandleTypeDef huart5;
extern DMA_HandleTypeDef hdma_uart5_rx;

void RC_unable(void)
{
    __HAL_UART_DISABLE(&huart5);
}

void RC_restart(uint16_t dma_buf_num)
{
    __HAL_UART_DISABLE(&huart5);
    __HAL_DMA_DISABLE(&hdma_uart5_rx);
    ((DMA_Stream_TypeDef *)hdma_uart5_rx.Instance)->NDTR = dma_buf_num;
    __HAL_DMA_ENABLE(&hdma_uart5_rx);
    __HAL_UART_ENABLE(&huart5);
}
